/**
 * 环境配置
 * 用于在开发环境和生产环境之间切换API端点
 */

const environments = {
  // 开发环境
  development: {
    user: 'http://localhost:8100/api/v1',
    swap: 'http://localhost:8101/api/v1',
    region: 'http://localhost:8102/api/v1',
    buddy: 'http://localhost:8103/api/v1',
    community: 'http://localhost:8104/api/v1',
    teacher: 'http://localhost:8105/api/v1'
  },

  // 生产环境（请替换为实际的生产域名）
  production: {
    user: 'https://api.yourdomain.com/user/api/v1',
    swap: 'https://api.yourdomain.com/swap/api/v1',
    region: 'https://api.yourdomain.com/region/api/v1',
    buddy: 'https://api.yourdomain.com/buddy/api/v1',
    community: 'https://api.yourdomain.com/community/api/v1',
    teacher: 'https://api.yourdomain.com/teacher/api/v1'
  },

  // 测试环境
  test: {
    user: 'http://localhost:8100/api/v1',
    swap: 'http://localhost:8101/api/v1',
    region: 'http://localhost:8102/api/v1',
    buddy: 'http://localhost:8103/api/v1',
    community: 'http://localhost:8104/api/v1',
    teacher: 'http://localhost:8105/api/v1'
  }
};

// 当前环境（可通过小程序配置或编译参数切换）
const currentEnv = 'development'; // 开发时使用 'development'，生产时改为 'production'

module.exports = {
  currentEnv,
  endpoints: environments[currentEnv],
  environments
};